package sort.leetcode_215_medium;

import java.util.Arrays;

public class SortSolution {
    /**
     *  先排序，排序后返回第k个大，第k个大对应的下标为 len - k
     */
    public int findKthLargest(int[] nums, int k) {
        if(nums == null || nums.length == 0){
            return 0;
        }
        int len = nums.length;
        Arrays.sort(nums);
        return nums[len - k];
    }
}
